//   Copyright 2012,2013 Vaughn Vernon
//
//   Licensed under the Apache License, Version 2.0 (the "License");
//   you may not use this file except in compliance with the License.
//   You may obtain a copy of the License at
//
//       http://www.apache.org/licenses/LICENSE-2.0
//
//   Unless required by applicable law or agreed to in writing, software
//   distributed under the License is distributed on an "AS IS" BASIS,
//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//   See the License for the specific language governing permissions and
//   limitations under the License.

package com.saasovation.agilepm.domain.model.product;

import java.util.Date;

import com.saasovation.agilepm.domain.model.tenant.TenantId;
import com.saasovation.common.domain.model.DomainEvent;

/**
 * @领域事件：产品讨论已发起
 */
public class ProductDiscussionInitiated implements DomainEvent {

    /**
     * 事件版本
     */
    private int eventVersion;
    /**
     * 发生日期
     */
    private Date occurredOn;
    /**
     * 产品讨论
     */
    private ProductDiscussion productDiscussion;
    /**
     * 产品ID
     */
    private ProductId productId;
    /**
     * 租户ID
     */
    private TenantId tenantId;

    /**
     * 由以下参数构造产品讨论已发起
     * @param aTenantId             租户ID
     * @param aProductId            产品ID
     * @param aProductDiscussion    产品讨论
     */
    public ProductDiscussionInitiated(
            TenantId aTenantId,
            ProductId aProductId,
            ProductDiscussion aProductDiscussion) {
        // 调用父类默认构造器
        super();

        this.eventVersion = 1;
        this.occurredOn = new Date();
        this.productDiscussion = aProductDiscussion;
        this.productId = aProductId;
        this.tenantId = aTenantId;
    }

    /**
     * 获取事件版本
     * @return  返回事件版本
     */
    @Override
    public int eventVersion() {
        return this.eventVersion;
    }

    /**
     * 获取发生日期
     * @return  返回发生日期
     */
    @Override
    public Date occurredOn() {
        return this.occurredOn;
    }

    /**
     * 获取 产品讨论
     * @return  返回产品讨论
     */
    public ProductDiscussion productDiscussion() {
        return this.productDiscussion;
    }

    /**
     * 获取 产品ID
     * @return  返回 产品ID
     */
    public ProductId productId() {
        return this.productId;
    }

    /**
     * 获取 租户ID
     * @return  返回租户ID
     */
    public TenantId tenantId() {
        return this.tenantId;
    }
}
